package stmo.符号表;

/**
 *  符号表测试类
 */

public class SymbolTableTest {

    public static void main(String[] args) {
        //创建符号表对象
        SymbolTable<Integer,String> symbolTable = new SymbolTable<>();

        //测试put方法（插入，替换）
        symbolTable.put(1,"111");
        symbolTable.put(2,"222");
        symbolTable.put(3,"333");
        symbolTable.put(4,"444");

        //测试get方法
        for (int i = 1;i <= symbolTable.size();i++) {
            System.out.println(symbolTable.get(i));
        }

        System.out.println("---------------");

        symbolTable.put(1,"888");
        for (int i = 1;i <= symbolTable.size();i++) {
            System.out.println(symbolTable.get(i));
        }

        System.out.println("---------------");

        //测试delete方法
        symbolTable.delete(4);
        for (int i = 1;i <= symbolTable.size();i++) {
            System.out.println(symbolTable.get(i));
        }
        System.out.println(symbolTable.size());
    }

}
